package com.rany.day08.demo07;

import java.util.ArrayList;
import java.util.Collections;

public class StudentTest {
    public static void main(String[] args) {
        ArrayList<Student> students = new ArrayList<>();
        Student student = new Student();
        student.setName("lin");
        student.setAge(26);
        Student student1 = new Student();
        student1.setName("lin1");
        student1.setAge(27);
        Student student2 = new Student();
        student2.setName("lu");
        student2.setAge(25);
        Collections.addAll(students,student,student1,student2);
        System.out.println(students);
        Collections.sort(students);
        System.out.println(students);
    }
}
